package Controller.reply;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class ReplyFormController implements Controller{

	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		Integer sr_no = Integer.parseInt(req.getParameter("sr_no"));
		Integer sb_no = Integer.parseInt(req.getParameter("sb_no"));
		System.out.println("넘어온 댓글의 시퀀스 값"+sr_no);
		System.out.println("넘어온 게시판의 시퀀스 값"+sb_no);
		
		HttpSession session = req.getSession();
		String m_id = (String)session.getAttribute("member");
		System.out.println("로그인한 아이디 : "+m_id);
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("replyform");
		mav.addObject("sr_no", sr_no);
		mav.addObject("sb_no", sb_no);
		mav.addObject("m_id", m_id);
		return mav;
	}

}
